import data from "../data"
import user from "../user"
import {observer,inject} from "mobx-react"

 function MyUser(props){
   console.log(props)
  const {
    count ,
    changeCount
  }  = data
  const {
     userInfo,
     changeUserInfo
  } = user ;
  return (
    <div>
      <h2> Myuser - 用户中心 </h2>
      <h2>count == {count } </h2>
      <button onClick={()=>changeCount(10)} >changecount</button>
      <h1>username == {userInfo.get("username")}</h1>
      <button onClick={()=>changeUserInfo({username:"zuozuomu"})}> change Userinfo </button>
    </div>
  )
}

export default inject("data","user")(observer(MyUser))

// observer(MyUser)  = @observer class 
// inject(observer(MyUser))("data","user")
// observer(inject(MyUser)("data",'user'))